package string;

public class StartsWithDemo {
    public static void main(String[] args) {
        /**
         * boolean startsWith(String s)
         * 判断字符串是否以s开头
         * boolean endWith(String s)
         * 判断字符串是否以s结束
         */
        /*
        String str = "thinking in java";
        boolean start = str.startsWith("think");
        System.out.println(start);
        boolean end=str.endsWith("java");
        System.out.println(end);
         */
        String str = "thinking in java";
        System.out.println(str.startsWith("think"));
        System.out.println(str.endsWith("java"));
    }
}